﻿#pragma once
#include <memory>

#include "../Manager/TextureMgr.h"
#include "../Physics/AABB.h"
#include "../Tool/Shader.h"
#include "../Primitive/GeometryGenerator.h"
#include "../Primitive/Transform.h"

namespace Kriko
{
    class RenderObject
    {
    private:
        std::shared_ptr<GeometryGenerator::MeshData> pMesh;
        std::shared_ptr<Shader> pShader;
        std::shared_ptr<Transform> pTransform;
        std::shared_ptr<Texture> pTexture;
        AABB aabb;
    public:
        void SetMesh(const std::shared_ptr<GeometryGenerator::MeshData>& mesh) { pMesh = mesh; }
        void SetShader(const std::shared_ptr<Shader>& shader) { pShader = shader; }
        void SetTransform(const std::shared_ptr<Transform>& transform) { pTransform = transform; }
        void SetTexture(const std::shared_ptr<Texture>& texture) { pTexture = texture; }

        std::shared_ptr<Texture> GetTexturePtr() const { return pTexture; }
        Texture& GetTextureRef() const { return *pTexture; }
        std::shared_ptr<GeometryGenerator::MeshData> GetMeshPtr() const { return pMesh; }
        std::shared_ptr<Shader> GetShaderPtr() const { return pShader; }
        std::shared_ptr<Transform> GetTransformPtr() const { return pTransform; }

        AABB& GetAABB();
    };
}
